import { Image } from "expo-image";
import { ImageSourcePropType, StyleSheet } from "react-native";

interface ImageViewerProps {
    imgSource: ImageSourcePropType;
    selectedImage?: string;
}

export default function ImageViewer({ imgSource, selectedImage }: ImageViewerProps) {
    const imageSource = selectedImage ? { uri: selectedImage } : imgSource;
    return <Image style={styles.image} source={imageSource} />
}

const styles = StyleSheet.create({
    image: {
        width: 310,
        height: 372,
        borderRadius: 15
    }
})